import { CHANGE_AGE } from "../action/type"

const _state = {
  name: 'pony',
  age: 18
}

export default (state = _state, { type, payload }) => {
  switch(type) {
    case CHANGE_AGE:
      return {
        ...state,
        age: payload
      }
    default:
      return state
  }
}